using System;
using System.Runtime.Serialization;
namespace TicketSellerService
{
	[DataContract]
	public class TicketReservation
	{
		[DataMember]
		public Flight flight { set; get;}
		
		[DataMember]
		public int reservationId { get; set;}
		
		[DataMember]
		public static int reservationsCounter = 0;
		
		public TicketReservation( Flight _flight) {
			flight = _flight;
			reservationId = ++reservationsCounter;
		}
		
		override public string ToString( ) {
			return String.Format( "{0} {1}", reservationId, flight.ToString( )); 
		}
	}
}

